#ifndef HTTP_H_
#define HTTP_H_

#include <netinet/in.h>
#include <ev.h>

struct http {
    char *request_start;
    /* request line */
    char *method_end;
    char *schema_start;
    char *schema_end;
    char *host0_start;
    char *host0_end;
    char *port_start;
    char *port_end;
    char *uri_start;
    char *uri_end;
    char *http_protocol_start;
    char *http_protocol_end;
    /* headers */
    char *header_name_start; /* temp */
    char *header_name_end; /* temp */
    char *header_start; /* temp */
    char *header_end; /* temp */
    /* useful header lines */
    char *host_start;
    char *host_end;
    char *proxy_connection_name_start;
    char *proxy_connection_name_end;

    unsigned is_connect_method;
    in_port_t port;
} http_head;

void http_header_handler(EV_P_ ev_io *w, int revents);

#endif /* HTTP_H_ */
